Selection Sort
code:hs
import Data.List (delete, insert, unfoldr)
selectionSort :: Ord a => a -> a selectionSort = unfoldr delmin
where
delmin :: Ord a => a -> Maybe (a, a) delmin [] = Nothing
delmin xs = Just (min, delete min xs)
where
min = minimum xs